Skip to content

v1.2.8: fix continuous scrolling + unified toolbar redesign - #106

Merged
sparshsam merged 8 commits into
mainfrom
feat/v1.2.8-toolbar-scroll
Nov 8, 2026
Merged

sparshsam merged 8 commits into
mainfrom
feat/v1.2.8-toolbar-scroll

Conversation

@sparshsam

Copy link
Copy Markdown
Owner

Summary

Fixes the critical continuous-scrolling bug and replaces the outdated two-row toolbar with a single Fluent-style command bar.

Root cause — continuous scrolling

_render_continuous() did not build a document. It built a sliding window around current_page (±5 pages):

  • only ~6 page widgets existed at any time, so the scrollbar's range covered just those pages;
  • next_page()/jump_to_page() re-centred the window and deleted the previous widgets, so pages already read became unreachable;
  • nothing observed the scrollbar, so the page indicator never changed while scrolling;
  • _perf_end(_t, …) referenced an undefined local, raising NameError on every continuous render.

With a 76-page PDF the old code produced 6 widgets and a 3,101 px scroll range; it now produces 76 widgets and a 47,844 px range.

What changed

Continuous scrolling (virtualized)

  • One correctly sized placeholder per page in a persistent layout, so the scroll range always spans the whole document.
  • Pixmaps are rendered lazily for the viewport plus overscan and released outside a small cache window; memory stays bounded at high zoom and for hundreds of pages.
  • Scrolling updates the page indicator; Next/Previous/page box/search jumps scroll in place without rebuilding; zoom changes preserve the reading position.
  • 500-page document: open + first render in 0.17 s, 4 pixmaps resident, jumps in 0.01 s.

Toolbar redesign

  • One 44 px row: file, page (N / total), zoom (− 81% + and Fit), annotations, and search.
  • Consistent 18 px vector icons drawn per theme in 30 px targets, with disabled variants, tooltips and accessible names.
  • Live zoom percentage; integrated search field with themed leading/trailing icons, match navigation and a semantic toggle.
  • Fits the default 1000 px window; degrades to the native toolbar extension menu on narrower widths.

Themes

  • Rewrote both stylesheets around a shared neutral palette with the OpenReader accent: pill tabs, hairline separators, themed scrollbars, menus, status bar, and empty state.
  • Icons and the empty-state glyph regenerate on theme change; the document viewport and empty state now carry the themed surface colour (dark mode previously showed a light content area).

Tabs

  • Switching tabs refreshes the page counter and page-box range to the active document; the tab strip hides when no documents are open.

Verification

  • python -m py_compile main.py tools/create_icon.py scripts/inject_version.py — OK
  • QT_QPA_PLATFORM=offscreen pytest tests/ — 160 passed, 18 skipped (22 new tests: 9 continuous-scrolling regressions, 13 toolbar/UI regressions)
  • Offscreen screenshots checked in light and dark for the empty state, document view, search highlighting, single-page mode, multi-tab, and narrow-window overflow.
  • Keyboard shortcuts, annotations, search, zoom, and multi-tab behaviour covered by the new UI suite.

Packaging

  • Version 1.2.8 propagated to main.py, AppxManifest.xml (1.2.8.0), AppInstaller.xml, the MCP package, and PKG-INFO via scripts/inject_version.py.
  • MSIX packaging tests pass; the Windows CI job builds the MSIX artifacts from this branch.
  • No Microsoft Store submission is included in this PR.

🤖 Generated with Claude Code

Fix the continuous view so it renders a full-document, virtualized layout
instead of a sliding window around the current page:

- one sized placeholder per page, so the scroll range spans the whole PDF
- lazy pixmap rendering for the viewport plus overscan, with a bounded cache
- scrolling updates the page indicator; navigation scrolls in place without
  rebuilding the layout or discarding pages; zoom preserves reading position
- remove the undefined `_t` NameError in `_render_continuous`

Replace the two stacked control rows with a single 44 px Fluent-style
toolbar: consistent 18 px vector icons, 30 px targets, grouped
file/page/zoom/annotation/search actions, live zoom percentage, a compact
page counter, and a themed search field with a semantic toggle.

Rewrite the light and dark stylesheets around a shared neutral palette with
theme-aware scrollbars, menus, tabs, status bar, and empty state; regenerate
icons and the empty-state glyph when the theme changes.

Also refresh the page controls when switching tabs and hide the tab strip
when no documents are open.

Add regression suites for continuous scrolling and the toolbar/UI (22 new
tests). Version bumped to 1.2.8 across main.py, the MSIX manifests,
AppInstaller, and the MCP package.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Deploying reader with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4a3d0c4
Status: ✅  Deploy successful!
Preview URL: https://3d033bed.reader-bsl.pages.dev
Branch Preview URL: https://feat-v1-2-8-toolbar-scroll.reader-bsl.pages.dev

View logs

sparshsam and others added 7 commits November 8, 2026 17:45
The new continuous-scrolling and toolbar tests need to protect the codebase,
so run the full suite offscreen in the CI validate job.

Co-Authored-By: Claude Code <noreply@anthropic.com>
A layout rebuild (zoom or tab switch) can leave the scrollbar range stale
when the target page is applied, so the immediate render pass could paint
the wrong pages and the settled target stayed blank until the next scroll.
Schedule a render whenever the pending scroll is applied, and cover it with
the zoom-retention test.

Co-Authored-By: Claude Code <noreply@anthropic.com>
1100x820 gives the new toolbar breathing room on Windows font metrics;
720x480 keeps the empty state and overflow menu usable when resized down.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
The new pytest step exposed a missing optional dependency: the bundled MCP
server builds its tool list at import time and needs `mcp.types.Tool`.
Install requirements-mcp.txt in the validate job.

Constrain the optional MCP dependency to 1.x. MCP 2.x moved the server API
used by pdfreader_lib/mcp_server.py, so an unbounded requirement would
install a version the v1.2.8 server cannot import. Verified on Python 3.11
with mcp 1.30.0: 160 passed, 18 skipped.

Co-Authored-By: Claude Code <noreply@anthropic.com>
openreader-mcp imports mcp.types.Tool, which moved in MCP 2.x. Match the
bundled server's requirements-mcp.txt constraint so `pip install
openreader-mcp` does not resolve to an SDK the server cannot import.

Co-Authored-By: Claude Code <noreply@anthropic.com>
- The release workflow now fails if MakeAppx is unavailable, and the
  publish job requires OpenReader.msix in the artifact set.
- Tag pushes build and upload artifacts only. The GitHub Release is
  created only by a manual workflow_dispatch with publish=true, after
  the artifacts and version metadata have been verified.
- Update the Store acceptance checklist to v1.2.8 (continuous scrolling,
  toolbar, themes, tab controls) and document the two-phase release.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@sparshsam
sparshsam merged commit 57c29ea into main Nov 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant